﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.TracingCommand;
using RBAC.MaHaiBo.Entity.Traceability;
using RBAC.MaHaiBo.Service.TraceabilityService;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.TracingHandler
{
    public class TracingFanTianCommandHamdler:IRequestHandler<TracingFanTianCommand, List<TracingDTO>>
    {
        /// <summary>
        /// 溯源服务层
        /// </summary>
        ITracingService TSer;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="TSer">溯源服务层</param>
        public TracingFanTianCommandHamdler(ITracingService TSer)
        {
            this.TSer = TSer;
        }

        public async Task<List<TracingDTO>> Handle(TracingFanTianCommand request, CancellationToken cancellationToken)
        {
            return await TSer.Tracinginfo(request.Tracingid);
        }
    }
}
